Count Objects In Months

I'm currently working on a program which will count all of the objects which were last modified from month-to-month between two dates. Here is the general outline of the program:

I created a dialog box which will allow the user to choose two dates, a start date and an end date. I want to look at all data between these two dates.

I know that I'll need to compare the first day of each month with the start date, and the last day of each month with the end date so that I can determine which months are between the start and end dates.

However, my real problem comes with looping through the months and counting all objects last modified within each month. I'm thinking that I should probably do something like export the number of modifications each month as I go through them, so I don't need to worry about overflow (does DXL even have, like, stacks or queues? If so, I guess either one of those would work as well.) But is there any way to look at each month between the start date and end date, and then loop through all objects which were last modified during that month?
Thanks so much for your help!
josiah820 - Fri Jun 22 14:51:55 EDT 2012

Re: Count Objects In Months
llandale - Fri Jun 22 15:22:12 EDT 2012

I'll assume your use of the word "modifications" should have been "Objects". But no, you won't need to export each month separately.

Someone else will help find the month boundaries, lets say:

  • 01-Apr-2012 12:00am
  • 01-May-2012 12:00am
  • 01-Jun-2012 12:00am

Thus you are looking for April and May changes.

for obj in mod do
{  datLast = obj."Last Modified On"
   for (i=0; i<NumMonths-2; i++)  do   // yes "-2" not "-1".-
   {  if (datMonths[i]   <= datLast   and
          datMonths[i+1] >  datLast) //
      then CountMonths[i]++
   }
}

 


-Louie